﻿using System;
using HigLabo.Net.Extensions;

namespace HigLabo.Net.WindowsLive
{
    /// <summary>
    /// 
    /// </summary>
    public class Activity : ResponseObject
    {
        /// <summary>
        /// 
        /// </summary>
        public IdName From { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public String Message { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public String Link { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public String Description { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public String Picture { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public String Name { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public String Source { get; set; }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="jsontext"></param>
        public Activity(String jsontext)
        {
            this.SetProperty(jsontext);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="jsontext"></param>
        public override void SetProperty(String jsontext)
        {
            var d = this.SetData(jsontext);
            if (d.ContainsKey("from"))
            {
                this.From = new IdName(d.ToString("from"));
            }
            this.Message = d.ToString("message");
            this.Link = d.ToString("link");
            this.Description = d.ToString("description");
            this.Picture = d.ToString("picture");
            this.Name = d.ToString("name");
            this.Source = d.ToString("source");
        }
    }
}
